home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ikmutl.asm < prev    next >
Encoding:
Assembly Source File  |  1992-09-29  |  111.1 KB  |  1,406 lines

  1. *COPY                                                 IKMUTL            05000000
  2.          CHECKVER IKCUTL,4.2                                   @SC90072 05000500
  3.          TITLE 'CWDSET/DSPACE Routines - set/show working directory'    05001000
  4. * Set new 'working directory', i.e., new code (need LSCAN or FILES)     05002000
  5. * Entry: SCANPTR string has option                                      05003000
  6. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged.   05004000
  7. CWDSET   ENTER                                                 @SC86164 05005000
  8.          NTOKN N=CWDRSET,H=CWDERR                                       05006000
  9.          C     7,F3                 Length MUST be 4                    05007000
  10.          BNE   CWDERR                                                   05008000
  11.          TM    UPRIVS,LSCAN+FILES   Need some priveleges to             05009000
  12.          BZ    CWDPRV               change code                         05010000
  13.          TR    0(4,6),UPCASE        Upper case it                       05011000
  14.          MVC   UCODE(4),0(6)        Save as new default code            05012000
  15.          MVI   DESTL,1              Yes, new code                       05013000
  16.          B     RTRN0                                           @SC86295 05014000
  17. CWDPRV   PTEXT 'Not enough privileges to change code'                   05015000
  18.          B     SUBERR                                                   05016000
  19. CWDRSET  MVI   DESTL,0              No more code. Default to user's     05017000
  20.          MVC   UCODE(4),$USRCDE     Get user's code from locore         05018000
  21.          B     RTRN0                                                    05019000
  22. CWDERR   PTEXT 'Must be a valid 4-digit MUSIC code'                     05020000
  23.          B     SUBERR               Go display error msg                05021000
  24. * * * * * * * * * * * * * * * * * * * * * *                             05022000
  25. *                                                                       05023000
  26. *                                                                       05024000
  27. *        DSPACE Routine - display available disk space         @SC86164 05025000
  28. *                                                                       05026000
  29. * Show space available in 'working directory' or other area             05027000
  30. * Entry: SCANPTR string has option (none => working directory)          05028000
  31. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged    05029000
  32. DSPACE   ENTER ALT                                             @SC86164 05030000
  33.          MFSET DSKST,USERCTL                                            05031000
  34.          MFREQ DSKST              Get User Control Record               05032000
  35.          LA    15,PARMAREA         Temporary output buffer              05033000
  36.          L     4,MFMAXS           Calculate space in use                05034000
  37.          S     4,MFACUR                                                 05035000
  38.          BAL   2,EDDEC            Convert to printable                  05036000
  39.          MVC   0(12,15),=C' KBytes Free'                                05037000
  40.          LA    0,12(15)                                                 05038000
  41.          LA    1,PARMAREA                                               05039000
  42.          SR    0,1                                                      05040000
  43.          WTEXT (1),(0)       Display the message                        05041000
  44.          B     RTRN0                                                    05042000
  45.          LOCALS ,                                              @SC86295 05043000
  46.          EXIT  ,                                               @SC86295 05044000
  47.          TITLE 'FSPEC Routine - extract filespec from scan string'      05045000
  48. *                                                                       05046000
  49. * Entry: R1->name field, R0=flags selecting operation (see below)       05047000
  50. *        For parse operations, SCANPTR defines the input string.        05048000
  51. *        For getting foreign or display filespec, R7->output buffer     05049000
  52. * Exit: if not FFNEW, then R15=0 if ok, 1 if ?, 2 if bad.               05050000
  53. *        For R15=1 or 2 R3,R4 give message.  ERRNUM may be leftover.    05051000
  54. *                                                                       05052000
  55. *                                 Flags:                  Notes:        05053000
  56. *   Tasks:               FFRCF FFSND FFGET FFNEW                        05054000
  57. * Parse RECV               X                     set ROVR properly      05055000
  58. * Parse SEND 1st                 X                                      05056000
  59. * Parse SEND 2nd           X     X                                      05057000
  60. * Parse GET 1st                        X                                05058000
  61. * Parse GET 2nd            X           X         set ROVR properly      05059000
  62. * Parse F-packet   (FFHDR) X     X     X                                05060000
  63. * Parse for Generic(FFUTL)       X     X         FFWLD: allow partial   05061000
  64. * Parse TAKE                                                            05062000
  65. *                                                                       05063000
  66. * Get unique name                            X     R15: 0=>ok, 1=>bad   05064000
  67. * Interactive name check               X     X     R15: 0=>ok, 1=>bad   05065000
  68. * Get foreign name (FFENC) X                 X     R15->end of string   05066000
  69. * Get display form (FFDSP)       X           X     R15->end of string   05067000
  70. *                                                                       05068000
  71. FSPEC    ENTER                                                 @SC86295 05069000
  72.          STC   0,FSPFLG                                        @SC86295 05070000
  73.          LR    5,0                                             @SC88049 05071000
  74.          SRL   5,4           Convert flags to index            @SC88049 05072000
  75.          AR    5,5                                             @SC88049 05073000
  76.          LR    0,1           Copy ptr to filespec              @SC86295 05074000
  77.          TM    FSPFLG,FFNEW                                    @SC86295 05075000
  78.          BO    FSPWRN                                          @SC86295 05076000
  79.          MVC   0(LFID,1),BLNAME  Clear the filename to blanks           05077000
  80.          PTEXT 'Invalid filename'                                       05078000
  81.          MVI   ERRNUM,ERRFNE Assume bad file name              @SC86158 05079000
  82.          LH    5,FSP0(5)     Get dispatch adr                  @SC88049 05080000
  83.          B     FSP0(5)       Go to proper handler              @SC88049 05081000
  84. *                                                                       05082000
  85. *                  Take        Get 1st     Send 1st    Generic          05083000
  86. FSP0     DC    AL2(FSPTAK-FSP0,FSPSN2-FSP0,FSPSND-FSP0,FSPUTL-FSP0)     05084000
  87. *                                                                       05085000
  88. *                  Receive    Get 2nd    Send 2nd    F-packet           05086000
  89.          DC    AL2(FSPRC-FSP0,FSPRC-FSP0,FSPSN2-FSP0,FSPHD-FSP0)        05087000
  90.          SPACE                                                          05088000
  91. FSPUTL   TM    FSPFLG,FFWLD  Utility: default to all files?    @SC88049 05089000
  92.          BZ    FSPASC        No                                @SC86295 05090000
  93.          MVC   0(5,1),UCODE  Default prefix                             05091000
  94.          MVI   5(1),C'*'     Yes                               @SC88308 05092000
  95. FSPSND   DS    0H                                                       05093000
  96. FSPASC   TM    FL2,SRV       Server mode?                      @SC86295 05094000
  97.          BZ    FSPCPY        No, don't need to convert         @SC86295 05095000
  98.          ICM   15,15,LEN     Get length                        @SC86295 05096000
  99.          BZ    FSPCPY                                          @SC86295 05097000
  100.          BCTR  15,0          Correct for EX                    @SC86158 05098000
  101.          L     5,ADR         Get string ptr                    @SC89215 05099000
  102.          EX    15,FSPTRAE    Change to EBCDIC                  @SC89215 05100000
  103.          EX    15,FSPTRUP    Upcase and dot to space           @SC89215 05101000
  104.          B     FSPCPY                                          @SC86295 05102000
  105. FSPTRAE  TR    0(,5),ATOED                                     @SC89301 05102300
  106. FSPTRUP  TR    0(,5),UPCASE                                    @SC89215 05102600
  107. FSPRC    NI    FL1,255-ROVR  Setup for RECEIVE                 @SC86295 05103000
  108.          NI    FL4,255-NMOK-NMCHNG  Collision not checked yet  @SC90033 05104000
  109.          MVI   0(1),C'$'     Default fn                        @SC88308 05105000
  110.          B     FSPCPY                                          @SC86295 05106000
  111. FSPHD    MVI   0(1),C'$'     Default fn                        @SC88308 05107000
  112.          L     2,ADR                                           @SC86295 05108000
  113.          IC    7,4(2)        Save possible code separator      @SC88308 05109000
  114.          TR    0(256,2),FSPTAB  Make valid fn chars            @SC86295 05110000
  115.          CLM   7,1,UPCASE+C':'  Was it a separator?            @SC88308 05111000
  116.          BNE   *+8                                             @SC88308 05112000
  117.           STC  7,4(2)        Yes, change char. back to colon   @SC88308 05113000
  118.          B     FSPCPY                                          @SC86295 05114000
  119. FSPSN2   MVI   0(1),0        Clear JFSPEC length !!!                    05115000
  120.          CLI   BRK,C','                                        @PG88306 05116000
  121.          BE    RTRN0         Foreign name omitted              @PG88306 05117000
  122.          NTOKN H=FSP2H,N=RTRN0                                          05118000
  123.          LA    7,1(7)        Not machine length !                       05119000
  124.          LA    1,L'JFNAM     Get maximum length                         05120000
  125.          CLM   7,3,*-2       Does it fit?                      @SC86224 05121000
  126.          BNH   *+6           Yes                               @SC86224 05122000
  127.          LR    7,1           Use what we can                   @SC86224 05123000
  128.          LR    3,0                                             @SC86295 05124000
  129.          STC   7,0(3)        Save length                       @SC86224 05125000
  130.          LA    0,1(3)                                          @SC86295 05126000
  131.          MVCL  0,6           Get fn, at least                  @SC86224 05127000
  132.          B     RTRN0                                           @SC86295 05128000
  133. *                                                                       05129000
  134. FSPTAK   DS    0H                                                       05130000
  135. FSPCPY   NTOKN H=FSPH,N=FSPZ                                            05131000
  136.          LR    8,0           Save start                                 05133000
  137.          KCALL FOPSTR,LFID(,8),E=FSPINV                        @SC89218 05133300
  138.          LA    1,LFID        Get max length                             05133600
  139.          CLI   4(6),C':'     Code prefix ?                              05134000
  140.          BE    FSPCPC                                                   05135000
  141.          LR    2,0                                                      05136000
  142.          MVC   0(5,2),UCODE  Add the user code                          05137000
  143.          LA    0,5(2)        Point past code prefix                     05138000
  144.          S     1,F5          Reduce receiving length                    05139000
  145. FSPCPC   TM    FSPFLG,FFRCF                                             05140000
  146.          BZ    FSPCPN                                          @SC86295 05141000
  147.          OI    FL1,ROVR      Overwrite received fname          @SC86295 05142000
  148. FSPCPN   LA    7,1(7)                                                   05143000
  149.          ICM   7,8,BLANK                                                05144000
  150.          MVCL  0,6           Copy token with padding                    05145000
  151.          CLM   7,7,F0        Hope nothing left over!                    05146000
  152.          BNE   FSPINV        Name was too long                          05147000
  153.          TR    0(LFID,8),UPCASE   Ok, now upcase it                     05148000
  154.          B     RTRN0                                           @SC86295 05149000
  155. *                                                                       05150000
  156. FSPZ     LR    14,0                                            @SC86295 05151000
  157.          CLI   0(14),C' '    Any default given?                @SC86295 05152000
  158.          BH    RTRN0         Yes, use it                       @SC86295 05153000
  159. FSPMIS   PTEXT 'Missing filename'                                       05154000
  160. FSPINV   LA    15,2                                            @SC86295 05155000
  161.          B     FSPPTRS                                         @SC86295 05156000
  162. *                                                                       05157000
  163. FSPH     PTEXT 'Filespec has format: fn[<first-last>]'         @SC89218 05158000
  164.          CLI   FSPFLG,FFSND  SEND 1st?                         @SC89218 05158200
  165.          BE    *+8           Yes, use whole message            @SC89218 05158400
  166.           SH   4,=H'14'      Chop off option part              @SC89218 05158600
  167.          B     FSP0H                                           @SC86295 05159000
  168. FSP2H    PTEXT 'Enter foreign filespec'                        @SC86295 05160000
  169. FSP0H    LA    15,1                                            @SC86295 05161000
  170. FSPPTRS  RETREG 3,4          Return msg ptrs                   @SC86295 05162000
  171. FSPRET   RET   ,                                               @SC86295 05164000
  172. *                                                                       05165000
  173. * Non-parsing functions . . .                                           05166000
  174. *                                                                       05167000
  175. * Get unique filespec                                                   05168000
  176. FSPWRN   LR    4,1           Save name ptr                     @SC86295 05169000
  177.          TM    FSPFLG,FFENC                                    @SC86295 05170000
  178.          BO    FSPENC        Encode name into buffer           @SC86295 05171000
  179.          TM    FSPFLG,FFDSP                                    @SC86295 05172000
  180.          BO    FSPDSP        Copy name into buffer for display @SC86295 05173000
  181.          TM    FL4,NMOK      Already checked?                  @SC87012 05174000
  182.          BO    RTRN0         Yes, ok                           @SC87012 05175000
  183.          MVC   XFILE,0(1)    Save original name                @SC90033 05175500
  184.          LA    6,LFID-2(1)   End of FT                                  05176000
  185.          BCTR  6,0                                             @BS86001 05177000
  186.          CLI   0(6),C' '     Find end of token                 @BS86001 05178000
  187.          BE    *-6                                             @BS86001 05179000
  188.          LA    5,10+1        Allowed retries                   @BS86001 05180000
  189.          LA    7,C'0'        Extra character                   @BS86001 05181000
  190.          OI    FL4,NMOK      Assume it checks                  @SC87012 05182000
  191. FSPSTA   OPENF T,(4),E=RTRN0 Does it exist already?            @SC86135 05183000
  192.          OI    FL4,NMCHNG    Yes, remember collision occurred  @SC90033 05183500
  193.          MVI   1(6),C'$'     Yes, modify Fn                             05184000
  194.          STC   7,2(6)        Serialize                         @BS86001 05185000
  195.          LA    7,1(7)        Bump counter                      @BS86001 05186000
  196.          BCT   5,FSPSTA                                        @BS86001 05187000
  197.          PTEXT 'Filename collision'                            @SC88049 05188000
  198.          B     FSP0H         Return error code                 @SC88049 05189000
  199. *                                                                       05190000
  200. * Encode name at (R1) into (R7) buffer (in ASCII), possibly with        05191000
  201. *  substitution from JFSPEC, but disable subsequent subst.              05192000
  202. *  Return updated ptr in R15                                            05193000
  203. FSPENC   LA    1,JFSPEC      Complex string?                   @SC86224 05194000
  204.          BAL   14,PAKFOR                                       @SC86224 05195000
  205.          LR    15,7          Save ptr                                   05196000
  206.          BNZ   FSPFILS       Yes, tokens aren't used           @SC86224 05197000
  207.          MVC   0(LFID,7),BLNAME                                         05198000
  208.          MVC   0(17,7),5(4)     Copy filename Only                      05199000
  209.          CLI   4(4),C':'        Is there a code prefix ???              05200000
  210.          BE    *+10                                                     05201000
  211.          MVC   0(LFID,7),0(4)   Copy token                              05202000
  212.          LA    1,LFID(7)        End of token if no blanks               05203000
  213.          TRT   0(LFID,7),TRTBL  Find 1st blank                          05204000
  214.          TR    0(LFID,7),ETOAD  ASCII it                       @SC89301 05205000
  215.          LR    15,1             New end of string                       05206000
  216. FSPFILS  MVI   JFSPEC,0      Turn off string                   @SC86224 05207000
  217.          B     FSPRET                                          @SC86295 05208000
  218. *                                                                       05209000
  219. * Copy name at (R1) into (R7) buffer in display form                    05210000
  220. *  Return updated ptr in R15                                            05211000
  221. FSPDSP   MVC   0(LFID,7),0(4)   Copy token                              05212000
  222.          CLI   4(4),C':'        Prefix already ?                        05213000
  223.          BE    FSPDTK3                                                  05214000
  224.          MVC   0(5,7),UCODE     Get prefix                              05215000
  225.          MVC   5(LFID-5,7),0(4)                                         05216000
  226. FSPDTK3  LA    1,LFID(7)        End of token if no blanks               05217000
  227.          TRT   0(LFID,7),TRTBL  Find 1st blank                          05218000
  228.          LR    15,1             New end of string                       05219000
  229.          B     FSPRET                                                   05220000
  230. *                                                                       05221000
  231. * Valid MUSIC file name characters                                      05222000
  232. FSPTAB   DC    75C'$',C'.'           dot                                05223000
  233.          DC    15C'$',C'$'           dollar sign                        05224000
  234.          DC    31C'$',C'#@'          pound sign, at sign       @SC88308 05225000
  235.          DC    04C'$',C'ABCDEFGHI'   a-i                                05226000
  236.          DC    07C'$',C'JKLMNOPQR'   j-r                                05227000
  237.          DC    08C'$',C'STUVWXYZ'    s-z                                05228000
  238.          DC    23C'$',C'ABCDEFGHI'   A-I                                05229000
  239.          DC    07C'$',C'JKLMNOPQR'   J-R                                05230000
  240.          DC    08C'$',C'STUVWXYZ'    S-Z                                05231000
  241.          DC    06C'$',C'0123456789'  0-9                                05232000
  242.          DC    06C'$'                                                   05233000
  243.          LOCALS ,                                              @SC86295 05234000
  244. FSPFLG   DS    X             Filespec flags                    @SC86295 05235000
  245. FSPEC    EXIT                                                  @SC86295 05236000
  246.          TITLE 'KHELP routine - perform HELP command'                   05237000
  247. * Handle HELP command, rest of string given by SCANPTR.                 05238000
  248. KHELP    ENTER ,                                               @SC86355 05239000
  249.          PTEXT 'LIST *COM:SYSTEM.KERMHELP',AREG=0,LREG=6       @SC88308 05240000
  250.          NI    FL4,255-UCMD  Signal ptrs in R0,R6              @SC88308 05241000
  251.          KCALL SUPFNC,3      Execute HOST command              @SC88308 05242000
  252.          B     RTRN                                            @SC88308 05243000
  253.          LOCALS ,                                                       05244000
  254. KHELP    EXIT  ,                                               @SC87007 05245000
  255.          TITLE 'SUPFNC Routine - various supervisor functions' @SC86158 05246000
  256. SUPFNC   ENTER                                                 @SC86295 05247000
  257. *  On entry, R1 = operation code, R0 = possible ptr            @SC86158 05248000
  258. * Exit: R15 set (0 => ok, <0 => illegal cmd, >0 => depends)             05249000
  259. *       ERRNUM set appropriately (R1=1,3,4) or unchanged (2,5-11)       05250000
  260. * 1 -> Start typeout interception.  N.B.  &MAXLR >> 2048 for this       05251000
  261. * 2 -> Clean up afterwards and stop interception                        05252000
  262. * 3 -> Execute host command with or without interception                05253000
  263. *      If UCMD set, SCANPTR gives text, else R0->text,R6=len            05254000
  264. * 4 -> Execute CP command with or without interception                  05255000
  265. *      R0->text, R6=len                                                 05256000
  266. * 5 -> Stop interception if going                                       05257000
  267. * 6 -> Retrieve original cmd parm string into CBUF (R15=1 if null)      05258000
  268. * 7 -> Test for stacked lines, return number in R15                     05259000
  269. * 8 -> Log off (doesn't return!)                                        05260000
  270. * 9 -> Wait specified time                                              05261000
  271. * 10-> Return clock time in R15 (centisec)                              05262000
  272. * 11-> Setup up new prompt string at (R0)                               05263000
  273.          BCT   1,ICPFIN                                        @SC86158 05264000
  274. * Start interception, initialize ptrs                          @SC86158 05265000
  275.          MVI   ERRNUM,ERRNOE OK                                @SC86158 05266000
  276.          LA    0,2048        Suitable offset                   @SC86158 05267000
  277.          A     0,WBUF        Output buffer                     @SC86158 05268000
  278.          L     1,TSENT       Limit                             @SC86158 05269000
  279.          LR    15,0                                            @SC86158 05270000
  280.          STM   15,0,TXTPTR   Save                              @SC86158 05271000
  281.          STM   0,1,SVCOPTR                                     @SC86158 05272000
  282.          SR    1,0           Get length                        @SC86158 05273000
  283.          L     15,=X'15000000'                                 @SC86158 05274000
  284.          MVCL  0,14          Fill with NL (X'15')              @SC86158 05275000
  285.          OI    SVCFLG,INTERCPT    Interception in Progress              05276000
  286.          B     RTRN0                                           @SC86295 05277000
  287. * Clean up after interception                                  @SC86295 05278000
  288. ICPFIN   BCT   1,ICPHST                                        @SC86158 05279000
  289.          L     5,SVCOPTR     End of text                       @SC86158 05280000
  290.          ST    5,TXTPTR+4    Save                              @SC86158 05281000
  291.          NI    SVCFLG,255-INTERCPT  Stop interception                   05282000
  292.          B     RTRN0                                                    05283000
  293. * Stop interception if going                                            05284000
  294. ICPRST   BCT   1,SFCLIN                                                 05285000
  295.          NI    SVCFLG,255-INTERCPT  Stop interception                   05286000
  296.          B     RTRN0                                                    05287000
  297. * Execute host command.  Save return code.                     @SC88308 05288000
  298. ICPHST   BCT   1,ICPCP                                         @SC86158 05289000
  299.          TM    FL4,UCMD                                        @SC88308 05290000
  300.          BO    *+12                                            @SC88308 05291000
  301.           ST   0,ADR         Ptrs are in R0,R6                 @SC88308 05292000
  302.           ST   6,LEN                                           @SC88308 05293000
  303.          NTOKN N=SFCHBAD                                       @SC88308 05294000
  304.          SCAN  HSTCMDS,RTRN0 Dispatch to handler               @SC88308 05295000
  305. SFCHBAD  HELP  HSTCMDS,RTRNM1                                  @SC88308 05296000
  306. *                                                                       05297000
  307. HSTCMDS  KW    'LIBRARY',SFCDIR,MIN=3                          @SC88308 05298000
  308.          KW    'COPY',SFCCOP,MIN=4                             @SC88308 05299000
  309.          KW    'PURGE',SFCDEL,MIN=3                            @SC88308 05300000
  310.          KW    'RENAME',SFCREN,MIN=3                           @SC88308 05301000
  311.          KW    'LIST',SFCTYP                                   @SC88308 05302000
  312.          KW    ,                                               @SC88308 05303000
  313. *                                                                       05304000
  314. SFCDIR   LA    3,13          DISKIO dir function code          @SC88308 05305000
  315.          B     SFCUTL                                          @SC88308 05306000
  316. SFCDEL   LA    3,14          DISKIO del function code          @SC88308 05307000
  317.          B     SFCUTL                                          @SC88308 05308000
  318. SFCREN   LA    3,15          DISKIO ren function code          @SC88308 05309000
  319.          B     SFCUTL                                          @SC88308 05310000
  320. SFCCOP   LA    3,16          DISKIO cop function code          @SC88308 05311000
  321.          B     SFCUTL                                          @SC88308 05312000
  322. SFCTYP   LA    3,17          DISKIO typ function code          @SC88308 05313000
  323. *        B     SFCUTL                                          @SC88308 05314000
  324. SFCUTL   SR    0,0                                             @SC88308 05315000
  325.          KCALL FSPEC,FILNAM,E=SUBERR                           @SC88308 05316000
  326.          CH    3,=H'14'                                        @SC88308 05317000
  327.          BNH   SFCUT1        Dir/lib or del/pur                @SC88308 05318000
  328.          CH    3,=H'17'                                        @SC88308 05319000
  329.          BE    SFCUT1        Type/list                         @SC88308 05320000
  330.          SR    0,0                                             @SC88308 05321000
  331.          KCALL FSPEC,IFILE,E=SUBERR Get 2nd file name          @SC88308 05322000
  332. SFCUT1   FTOKN N=SFCUT6      See if anything else in command   @SC88308 05323000
  333.          PTEXT 'No more operands'                              @SC88308 05324000
  334.          B     SUBERR                                          @SC88308 05325000
  335. SFCUT6   LR    0,3           Get function code                 @SC88308 05326000
  336.          LA    2,IFILE       Optional 2nd name                 @SC88308 05327000
  337.          KCALL DISKIO,FILNAM Do it                             @SC88308 05328000
  338.          B     RTRN                                            @SC88308 05329000
  339. * Execute CP command at (R0) with text interception            @SC86158 05330000
  340. ICPCP    BCT   1,ICPRST                                        @SC86158 05331000
  341.          WTEXT 'CP commands not supported'                              05332000
  342.          B     RTRN0                                                    05333000
  343. *                                                                       05334000
  344. SFCLIN   BCT   1,SFCSTK                                        @SC86295 05335000
  345. * Retrieve original command line arguments, if any             @SC86295 05336000
  346. *   Return code =0 if yes, =1 if no                            @SC86295 05337000
  347. *   Leave string in CBUF buffer (up to 256), length in CLEN    @SC86295 05338000
  348.          L     1,ORGR1       Get original R1                            05339000
  349.          L     1,0(,1)                                                  05340000
  350.          LH    2,0(,1)       Get command line parm length               05341000
  351.          LA    3,2(,1)       Get address of parms                       05342000
  352.          LTR   2,2           Any parms ???                              05343000
  353.          BZ    RTRN1                                                    05344000
  354.          ST    2,CLEN        Save the length                            05345000
  355.          L     4,CBUF        Copy to other buffer                       05346000
  356.          MVC   0(128,4),0(3)                                            05347000
  357.          LA    3,0(2,3)      Now, backscan the command line             05348000
  358. SFCLIN3  BCTR  3,0           buffer to check if there is really         05349000
  359.          CLI   0(3),C' '     something. MUSIC should have set the       05350000
  360.          BNE   RTRN0         length to 0, but under DEBUG, we           05351000
  361.          BCT   2,SFCLIN3     get a blank line of length 80 !!!          05352000
  362.          B     RTRN1                                                    05353000
  363. *                                                                       05354000
  364. * Test for stacked commands                                    @SC86295 05355000
  365. *   return code = number of stacked lines                      @SC86295 05356000
  366. SFCSTK   BCT   1,SFCKIL                                        @SC86295 05357000
  367.          ICM   15,15,GTPB+4  Anything in line buffer?                   05358000
  368.          BH    RTRN1         There's one line, at least                 05359000
  369.          B     RTRN0         Nothing stacked                            05360000
  370. *                                                                       05361000
  371. * Log out                                                      @SC86295 05362000
  372. SFCKIL   BCT   1,SFCWT                                         @SC86295 05363000
  373.          LA    1,OFFARG      Schedule a signoff to the system           05364000
  374.          SVC   237               $SETSAV                                05365000
  375.          LA    15,0          And abort the job right away.              05366000
  376.          SVC   $EOJ                                                     05367000
  377.          B     RTRN                                                     05368000
  378. *                                                                       05369000
  379. * Wait specified time in R0 (sec)                                       05370000
  380. SFCWT    BCT   1,SFCCLK      Tell MUSIC to delay for x seconds          05371000
  381.          SVC   $DLYEXC                                                  05372000
  382.          B     RTRN0                                           @SC86295 05373000
  383. *                                                                       05374000
  384. * Return time in centisec in R15                                        05375000
  385. SFCCLK   BCT   1,SFCPRP                                        @SC87351 05376000
  386.          STCK  TMPDW         Store TOD clock                   @SC86295 05377000
  387.          LM    14,15,TMPDW                                     @SC86295 05378000
  388.          SLDL  14,8          Take mod 204 days                 @SC86295 05379000
  389.          SRDL  14,20         Get in microsec                   @SC86295 05380000
  390.          D     14,=F'10000'  Get in centisec                   @SC86295 05381000
  391.          B     RTRN                                            @SC86295 05382000
  392. *                                                                       05383000
  393. SFCPRP   B     RTRN0         No action for prompting           @SC87351 05384000
  394. OFFARG   DC    CL6'/OFF**',X'A0'                                        05385000
  395.          LOCALS ,                                              @SC86295 05386000
  396. SUPFNC   EXIT                                                  @SC86158 05387000
  397.          TITLE 'Interception Code'                                      05388000
  398. *                                                                       05389000
  399. *  Entry:  R0->Length of string to write, R1->Address of string         05390000
  400. *                                                                       05391000
  401. *  Exit:   Always R15=0                                                 05392000
  402. *                                                                       05393000
  403. ICPTYP   ENTER                                                          05394000
  404.          LR    2,0                Get length in R2                      05395000
  405.          LM    3,4,SVCOPTR        Yes, then add the line just           05396000
  406.          SR    4,3                built to the interception buffer      05397000
  407.          CR    2,4                Any room left ?                       05398000
  408.          BH    RTRN0                                                    05399000
  409.          BCTR  2,0                                                      05400000
  410.          EX    2,ICPMV            Move the line to the output buffer    05401000
  411.          LA    2,1(2)                                                   05402000
  412.          LA    3,1(2,3)           Update the source pointer             05403000
  413.          ST    3,SVCOPTR          Save it                               05404000
  414.          B     RTRN0                                                    05405000
  415. ICPMV    MVC   0(0,3),0(1)                                              05406000
  416.          LOCALS ,                                                       05407000
  417. ICPTYP   EXIT   ,                                                       05408000
  418.          TITLE 'SETMSG Routine - controls CP breakin'                   05409000
  419. * Entry: R1 selects operation                                           05410000
  420. * Exit: R15=0 if ok                                                     05411000
  421. * 1-> Analyze user environment, determine if suitable.                  05412000
  422. *     Save quantities needed and condition line for entering commands.  05413000
  423. *     Perform any system-dependent initialization.                      05414000
  424. * 2-> Condition line for protocol transfers.                            05415000
  425. * 3-> Decondition line at end of transfer.                              05416000
  426. * 4-> System-dependent clean-up at exit.                                05417000
  427. * 5-> Reperform system-dependent initialization after SET LINE.         05418000
  428. SETMSG   ENTER ,                                                        05419000
  429.          BCT   1,STM2                Go if R1 not 1, so no init         05420000
  430.          MFARG 0,RLAB=ZRC,ULAB=ZLU                             @PG90057 05421000
  431.          MFARG NAME=MFNAME,INFIN=ZINFIN,INFOUT=ZINFOUT,ARG=ZARG         05422000
  432.          MFARG PHYS=ZPHYS,UCTL=ZUCTL,UINFO=ZUINFO,TAG=MFTAG             05423000
  433.          MFARG EOFPT=ZEOFPT,FSARG=ZFSARG                                05424000
  434.          MFGEN AREA=DSKST                                               05425000
  435.          MVC   UCODE(4),$USRCDE   Get the user's code                   05426000
  436.          MVI   UCODE+4,C':'  Set up 5-char prefix string                05427000
  437.          MVI   SCODE+4,C':'  Ditto                             @SC88308 05428000
  438.          LA    1,STMNOPR                                                05429000
  439.          SVC   $SETOPT            Disable prompting                     05430000
  440.          LA    1,STMTXLC                                                05431000
  441.          SVC   $SETOPT            Allow lower case input                05432000
  442.          MVI   TRMTP,C'T'    1st assume TTY                    @SC88203 05433000
  443.          TM    $TRMTYP,X'20'      Check the terminal type               05434000
  444.          BZ    RTRN0                                                    05435000
  445.          MVI   TRMTP,C'S'         Remember going via S/1                05436000
  446.          L     8,S1RDPL                                        @SC88203 05437000
  447.          XC    0(9,8),0(8)   Zero out buffer                   @SC88203 05438000
  448.          LA    0,1                                             @SC88203 05439000
  449.          KCALL SCRNIO        Clear screen and set up           @SC88203 05440000
  450. *        LA    0,6                                             @SC88203 05441000
  451. *        KCALL SCRNIO,STMS1ST Issue status request             @SC88203 05442000
  452. *        LA    0,5                                             @SC88203 05443000
  453. *        KCALL SCRNIO,S1RDPL Read back status                  @SC88203 05444000
  454. *        LA    0,2                                             @SC88203 05445000
  455. *        KCALL SCRNIO        Release screen                    @SC88203 05446000
  456. *        CLI   0(8),X'E4'    Check for Yale status response    @SC88203 05447000
  457. *        BE    *+12          Ok                                @SC88203 05448000
  458. *         CLI  0(8),0        Check for Yale status response    @SC88203 05449000
  459. *         BNE  STMGRP        No, must be something else        @SC88203 05450000
  460. *        CLI   3(8),X'11'                                      @SC88203 05451000
  461. *        BNE   STMGRP        No, must be something else        @SC88203 05452000
  462. *        CLC   =X'2B5B5B',6(8)                                 @SC88203 05453000
  463.          BE    RTRN0         Yes, all set                      @SC88203 05454000
  464. STMGRP   MVI   TRMTP,C'G'    Assume graphics device            @SC88203 05455000
  465.          B     RTRN0                                                    05456000
  466. *  Condition Line for protocol transfers                                05457000
  467. STM2     BCT   1,STM3                                                   05458000
  468.          CLI   TRMTP,C'V'                                      @SC89020 05458300
  469.          BE    *+12          TTY ==> limited                   @SC89020 05458600
  470.          CLI   TRMTP,C'T'         TTY terminals can't change handshk    05459000
  471.          BNE   STM2X                                                    05460000
  472.          CLI   S1HND,XON          User want special one anyway ?        05461000
  473.          BNE   STM2X                                                    05462000
  474.          MVI   S1HND,0            System provides the handshake!        05463000
  475. STM2X    B     RTRN0                                                    05464000
  476. *  Decondition line at end of transfer                                  05465000
  477. STM3     BCT   1,STM4                                          @SC86316 05466000
  478.          B     RTRN0                                                    05467000
  479. *  System cleanup at exit                                               05468000
  480. STM4     BCT   1,STM5        Special clean-up                  @SC87351 05469000
  481.          LA    1,STMPRMT     Turn on prompting                          05470000
  482.          SVC   $SETOPT                                                  05471000
  483.          LA    1,STMTXUC     Fold lower case to upper case              05472000
  484.          SVC   $SETOPT                                                  05473000
  485.          B     RTRN0         Special clean-up done                      05474000
  486. *                                                                       05475000
  487. STM5     B     RTRN1         Other lines not allowed                    05476000
  488. *                                                                       05477000
  489. STMNOPR  DC    X'A0',AL1(1,3,6) Turn off Prompting                      05478000
  490. STMPRMT  DC    X'A0',AL1(0,3,6) Turn on Prompting                       05479000
  491. STMTXLC  DC    X'A0',AL1(1,1,6) Text Lower Case Input                   05480000
  492. STMTXUC  DC    X'A0',AL1(0,1,6) Text Upper Case Input                   05481000
  493. *                                                                       05482000
  494. STMS1ST  DC    A(STMS1ORD,L'STMS1ORD)                          @SC88203 05483000
  495. STMS1ORD DC    X'C32B5BBC'   WCC + Yale ASCII status request   @SC88203 05484000
  496.          LOCALS ,                                                       05485000
  497. SETMSG   EXIT                                                           05486000
  498.          TITLE 'GETLIN Routine - Get a line from terminal'     @SC87015 05487000
  499. * Entry: R1->buffer of length 256                              @SC87015 05488000
  500. * Exit: Buffer filled, R0=length, R15=0 if ok. Else R15=1.     @SC87015 05489000
  501. GETLIN   ENTER                                                 @SC87015 05490000
  502.          LR    8,1           Save buffer ptr                   @SC88095 05491000
  503.          LA    9,256         For copying                       @SC88095 05492000
  504.          LM    4,6,GTPB      Saved ptrs: start, length, current         05493000
  505.          LTR   5,5           Already got something?            @SC88095 05494000
  506.          BNZ   GTL1          Yes, return it                    @SC87015 05495000
  507.          TGET  (4),130       Read a line from the terminal              05496000
  508.          SLR   2,2           Clear length for return                    05497000
  509.          LA    5,0(1,4)      Point past the end                         05498000
  510.          BCTR  5,0           Scan back for a non-blank                  05499000
  511.          CLI   0(5),C' '                                                05500000
  512.          BE    *-6                                                      05501000
  513.          LA    5,1(,5)                                                  05502000
  514.          SR    5,4           Stripped length                            05503000
  515.          BNH   GTLA          Null input                                 05504000
  516.          LR    6,4           Set current read ptr                       05505000
  517.          ST    5,GTPB+4      Save new length                            05506000
  518. GTL1     LR    1,5           Length of stuff                   @SC88095 05507000
  519.          AR    1,4           End of buffer                     @SC88095 05508000
  520.          LR    0,1           Save end                          @SC88095 05509000
  521.          LR    2,1                                             @SC88095 05510000
  522.          SR    2,6           Length of text remaining          @SC88095 05511000
  523.          BNP   GTLA          None, return length 0             @SC88095 05512000
  524.          SLR   4,4                                             @SC88095 05513000
  525.          IC    4,LNDLM       Get delimiter                     @SC88095 05514000
  526.          LA    4,TRTBL(4)    Ptr to delimiter char             @SC88095 05515000
  527.          MVI   0(4),1        Set up to snag delims             @SC88095 05516000
  528.          MVI   TRTBL+C' ',0  And ignore blanks                 @SC88095 05517000
  529.          CR    2,9           Get shorter of 256 and string     @SC88095 05518000
  530.          BNH   *+6                                             @SC88095 05519000
  531.           LR   2,9                                             @SC88095 05520000
  532.          BCTR  2,0           Set up for EX                     @SC88095 05521000
  533.          EX    2,GTLTRT                                        @SC88095 05522000
  534.          MVI   0(4),0        Now clear out table               @SC88095 05523000
  535.          MVI   TRTBL+C' ',1  And restore                       @SC88095 05524000
  536.          SR    1,6           Length of line                    @SC88095 05525000
  537.          LR    7,1           Set up MVCL                       @SC88095 05526000
  538.          CR    9,7           Get shorter of 256 and string     @SC88095 05527000
  539.          BNH   *+6                                             @SC88095 05528000
  540.           LR   9,7                                             @SC88095 05529000
  541.          LR    2,9           Length actually copied            @SC88095 05530000
  542.          MVCL  8,6                                             @SC88095 05531000
  543.          AR    6,7           In case we couldn't use it all    @SC88095 05532000
  544.          CR    6,0           Finished input?                   @SC88095 05533000
  545.          BNL   GTLA          Yes, release it                   @SC88095 05534000
  546.          LA    6,1(,6)       Skip over linend char             @SC88095 05535000
  547.          ST    6,GTPB+8      Next read ptr                     @SC88095 05536000
  548.          B     GTLZ          Return                            @SC88095 05537000
  549. GTLA     MVC   GTPB+4,F0     Clear input indicator             @SC87015 05538000
  550. GTLZ     RETREG (0,2)        Return (2) as R0                  @SC89218 05539000
  551.          B     RTRN0                                           @SC87015 05541000
  552. GTLTRT   TRT   0(,6),TRTBL   Find a delimiter                  @SC88095 05542000
  553.          LOCALS ,                                              @SC87015 05543000
  554. GETLIN   EXIT  ,                                               @SC87015 05544000
  555.          TITLE 'TERMIO Routine - Handle terminal I/O'                   05545000
  556. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05546000
  557. * successfull, R15 returns transferred byte count (else returns -1).    05547000
  558. *               Command code is in R0:                                  05548000
  559. * 1 => Open line for I/O            4 => Write packet                   05549000
  560. * 2 => Close line                   5 => Read packet                    05550000
  561. * 3 => Reset line status after    ( 6 => Write message ) not used       05551000
  562. *      environment changes                                              05552000
  563. *                                                                       05553000
  564. TERMIO   ENTER                                                          05554000
  565.          SR    15,15         OK                                @SC86295 05555000
  566.          BCT   0,TRMCLS                                        @SC86295 05556000
  567. * Open terminal line for protocol                                       05557000
  568.          MVI   RIOC,X'80'    Nothing saved                     @SC86295 05558000
  569.          MVI   TRMFLG,X'FF'  Initialize w/r flag               @SC87275 05559000
  570.          LA    1,STMNOCR                                                05560000
  571.          SVC   $SETOPT       No CRLF added                              05561000
  572.          LA    1,STMNOTR                                                05562000
  573.          SVC   $SETOPT       No translate Input                         05563000
  574.          LA    1,STMNOER                                                05564000
  575.          SVC   $SETOPT       No *TRANSMISSION ERROR messages            05565000
  576.          CLI   TIMOUT,0      Timeout wanted ???                         05566000
  577.          BE    RTRN0                                                    05567000
  578.          LA    1,STMTMOU                                                05568000
  579.          SVC   $SETOPT       Timeout on reads                           05569000
  580.          B     RTRN0                                                    05570000
  581. * Close terminal line after protocol transfer                           05571000
  582. TRMCLS   BCT   0,TRMRSET                                       @SC86295 05572000
  583.          LA    1,STMCRLF     Reenable CRLF                              05573000
  584.          SVC   $SETOPT                                                  05574000
  585.          LA    1,STMTRIN     Reenable translation                       05575000
  586.          SVC   $SETOPT                                                  05576000
  587.          LA    1,STMNOTM     No timeouts                                05577000
  588.          SVC   $SETOPT                                                  05578000
  589.          LA    1,STMTRER                                                05579000
  590.          SVC   $SETOPT       *TRANSMISSION ERROR messages allowed       05580000
  591.          B     RTRN0                                           @SC86295 05581000
  592. * (Re)set terminal characteristics to suit environment                  05582000
  593. TRMRSET  BCT   0,TRMRW                                         @SC86295 05583000
  594.          B     RTRN0                                           @SC86295 05584000
  595. *                                                                       05585000
  596. *  Perform I/O request                                                  05586000
  597. TRMRW    BCT   0,TRMRD                                         @SC87275 05587000
  598.          CLI   WRRD,0        Write/read?                       @SC87275 05588000
  599.          BNE   *+8           No, do it immediately                      05589000
  600.          MVI   TRMFLG,0      Indicate no action on follow-up            05590000
  601.          LM    2,3,0(1)      Get buffer address + length                05591000
  602.          BCTR  2,0           Backup to insert carriage control          05592000
  603.          MVI   0(2),X'41'    No output translate PLEASE !               05593000
  604.          ST    2,TRMRBUF     Setup I/O buffer for MFIO                  05594000
  605.          LA    3,1(3)        Fixup length for CC added                  05595000
  606.          ST    3,TRMRLEN     Set I/O length                             05596000
  607.          MFREQ PRT                                                      05597000
  608.          B     RTRN0                                           @SC87275 05598000
  609. *                                                                       05599000
  610. TRMRD    TS    TRMFLG                                          @SC87275 05600000
  611.          BZ    RTRN0         Just a follow-up. 0-length read   @SC87275 05601000
  612.          LM    2,3,0(1)                                                 05602000
  613.          C     3,AMAXRT      Check for maximum length                   05603000
  614.          BL    TRMRD3                                                   05604000
  615.          L     3,AMAXRT      Not too long please...                     05605000
  616. TRMRD3   ST    2,TRMRBUF     Setup I/O buffer for MFIO                  05606000
  617.          ST    3,TRMRLEN     Set I/O length                             05607000
  618.          SLR   4,4                                                      05608000
  619.          SLR   5,5                                                      05609000
  620.          MVCL  2,4           Clear the input buffer                     05610000
  621.          MFREQ TRM                                                      05611000
  622.          ICM   15,15,TRMARSZ Get number of bytes read                   05612000
  623.          BNZ   RTRN          Ok, got a buffer                           05613000
  624.          L     2,TRMRBUF                                                05614000
  625.          MVI   0(2),X'2B'    Timeout !!!                                05615000
  626.          B     RTRN1         Return Length 1                            05616000
  627. *                                                                       05617000
  628. STMNOCR  DC    X'A0',AL1(1,1,5) Turn off CRLF                           05618000
  629. STMCRLF  DC    X'A0',AL1(0,1,5) Turn on CRLF                            05619000
  630. STMNOTR  DC    X'A0',AL1(1,1,4) Turn off input translation              05620000
  631. STMTRIN  DC    X'A0',AL1(0,1,4) Turn on input translation               05621000
  632. STMTMOU  DC    X'A0',AL1(1,1,0) Turn on Timeout                         05622000
  633. STMNOTM  DC    X'A0',AL1(0,1,0) Turn off Timeout                        05623000
  634. STMNOER  DC    X'A0',AL1(0,1,7) Don't allow *TRANSMISSION ERROR msg     05624000
  635. STMTRER  DC    X'A0',AL1(1,1,7) Allow *TRANSMISSION ERROR msg           05625000
  636.          SPACE                                                          05626000
  637. *********************************************************************** 05627000
  638. *                                                                     * 05628000
  639. *    Reversing Table. Translate ASCII to reverse ASCII                * 05629000
  640. *                                                                     * 05630000
  641. *********************************************************************** 05631000
  642.          SPACE 1                                                        05632000
  643. *                0 1 2 3 4 5 6 7 8 9 A B C D E F                        05633000
  644. ATORA    DC    X'008040C020A060E0109050D030B070F0' 0                    05634000
  645.          DC    X'088848C828A868E8189858D838B878F8' 1                    05635000
  646.          DC    X'048444C424A464E4149454D434B474F4' 2                    05636000
  647.          DC    X'0C8C4CCC2CAC6CEC1C9C5CDC3CBC7CFC' 3                    05637000
  648.          DC    X'028242C222A262E2129252D232B272F2' 4                    05638000
  649.          DC    X'0A8A4ACA2AAA6AEA1A9A5ADA3ABA7AFA' 5                    05639000
  650.          DC    X'068646C626A666E6169656D636B676F6' 6                    05640000
  651.          DC    X'0E8E4ECE2EAE6EEE1E9E5EDE3EBE7EFE' 7                    05641000
  652.          DC    X'018141C121A161E1119151D131B171F1' 8                    05642000
  653.          DC    X'098949C929A969E9199959D939B979F9' 9                    05643000
  654.          DC    X'058545C525A565E5159555D535B575F5' A                    05644000
  655.          DC    X'0D8D4DCD2DAD6DED1D9D5DDD3DBD7DFD' B                    05645000
  656.          DC    X'038343C323A363E3139353D333B373F3' C                    05646000
  657.          DC    X'0B8B4BCB2BAB6BEB1B9B5BDB3BBB7BFB' D                    05647000
  658.          DC    X'078747C727A767E7179757D737B777F7' E                    05648000
  659.          DC    X'0F8F4FCF2FAF6FEF1F9F5FDF3FBF7FFF' F                    05649000
  660. *********************************************************************** 05650000
  661. *                                                                     * 05651000
  662. *    Reversing Table. Reverse ASCII to ASCII. Lose high order bit.    * 05652000
  663. *                                                                     * 05653000
  664. *********************************************************************** 05654000
  665.          SPACE 1                                                        05655000
  666. *                0 1 2 3 4 5 6 7 8 9 A B C D E F                        05656000
  667. RATOA    DC    X'00004040202060601010505030307070' 0                    05657000
  668.          DC    X'08084848282868681818585838387878' 1                    05658000
  669.          DC    X'04044444242464641414545434347474' 2                    05659000
  670.          DC    X'0C0C4C4C2C2C6C6C1C1C5C5C3C3C7C7C' 3                    05660000
  671.          DC    X'02024242222262621212525232327272' 4                    05661000
  672.          DC    X'0A0A4A4A2A2A6A6A1A1A5A5A3A3A7A7A' 5                    05662000
  673.          DC    X'06064646262666661616565636367676' 6                    05663000
  674.          DC    X'0E0E4E4E2E2E6E6E1E1E5E5E3E3E7E7E' 7                    05664000
  675.          DC    X'01014141212161611111515131317171' 8                    05665000
  676.          DC    X'09094949292969691919595939397979' 9                    05666000
  677.          DC    X'05054545252565651515555535357575' A                    05667000
  678.          DC    X'0D0D4D4D2D2D6D6D1D1D5D5D3D3D7D7D' B                    05668000
  679.          DC    X'03034343232363631313535333337373' C                    05669000
  680.          DC    X'0B0B4B4B2B2B6B6B1B1B5B5B3B3B7B7B' D                    05670000
  681.          DC    X'07074747272767671717575737377777' E                    05671000
  682.          DC    X'0F0F4F4F2F2F6F6F1F1F5F5F3F3F7F7F' F                    05672000
  683.          LOCALS ,                                              @SC86295 05673000
  684.          EXIT                                                           05674000
  685.          TITLE 'SCRNIO Routine - Handle screen I/O via Series/1'        05675000
  686. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05676000
  687. * successfull, R15 returns transferred byte count (else returns -1).    05677000
  688. *               Command code is in R0:                                  05678000
  689. * 0 => Clear screen on console (not comm line)                 @SC90045 05678500
  690. * 1 => Open screen for I/O            4 => Write packet                 05679000
  691. * 2 => Close screen                   5 => Read packet                  05680000
  692. * 3 => Reset screen status after      6 => Write message                05681000
  693. *      environment changes                                              05682000
  694. *                                                                       05683000
  695. SCRNIO   ENTER                                                          05684000
  696.          XC    ZFSARG(20),ZFSARG  Clear FSIO Control Block              05685000
  697.          LTR   0,0                                             @SC90045 05685300
  698.          BZ    SCRCLR                                          @SC90045 05685600
  699.          BCT   0,SCRCLS                                        @SC86295 05686000
  700.          MVI   TRMFLG,X'FF'       Initialize W/R flag          @PG90058 05686500
  701. SCRCLRA  MVI   FSFSFG,X'84'  Write erase needed to setup FSIO  @SC90045 05687000
  702.          MVI   FSFSFG+1,X'60'     No data Compression                   05688000
  703.          MVI   ZLU,9              Specify Unit 9                        05689000
  704.          MFSET DSKST,FSIO                                               05690000
  705.          MFREQ DSKST              Do the I/O                            05691000
  706.          B     RTRN0                                           @SC86295 05692000
  707. *                                                                       05692100
  708. SCRCLR   CLI   TRMTP,C'T'    Is it a TTY terminal?             @SC90045 05692200
  709.          BE    RTRN0         Yes, can't clear screen           @SC90045 05692300
  710.          CLI   TRMTP,C'V'    Is it a TTY terminal?             @SC90045 05692400
  711.          BE    RTRN0         Yes, can't clear screen           @SC90045 05692500
  712.          TM    FL2,PROTO     In protocol mode?                 @SC90045 05692600
  713.          BO    RTRN0         Yes, skip clearing screen         @SC90045 05692700
  714.          B     SCRCLRA       Do it                             @SC90045 05692800
  715. *                                                                       05693000
  716. SCRCLS   BCT   0,SCRRSET                                       @SC86295 05694000
  717.          B     RTRN0                                           @SC86295 05695000
  718. * (Re)set device characteristics to suit environment                    05696000
  719. SCRRSET  BCT   0,SCRRW                                         @SC86295 05697000
  720.          B     RTRN0                                                    05698000
  721. *                                                                       05699000
  722. *  Perform I/O request                                                  05700000
  723. SCRRW    BCT   0,SCRRD                                                  05701000
  724.          CLI   WRRD,0             Write/Read ?                 @PG90058 05702000
  725.          BE    SCRWO                                           @PG90058 05702200
  726.          MVC   RIOPRP(8),0(1)     Save Write data as Read Prmp @PG90058 05702400
  727.          B     RTRN0                                           @PG90058 05702600
  728. SCRWO    MVI   FSFSFG,X'06'       WCC included, Skip read      @PG90058 05702800
  729.          MVI   FSFSFG+1,X'A0'     No data Compression                   05703000
  730.          MVC   FSFSWL(4),4(1)     Get buffer length                     05704000
  731.          MVC   FSFSWB(4),0(1)     Get buffer address                    05705000
  732.          MVI   ZLU,9              Specify Unit 9                        05706000
  733.          MVI   TRMFLG,0           Indicate no actn on followup @PG90058 05706500
  734.          MFSET DSKST,FSIO                                               05707000
  735.          MFREQ DSKST              Do the I/O                            05708000
  736.          B     RTRN0                                                    05709000
  737. *                                                                       05709500
  738. SCRRD    BCT   0,SCRWM                                                  05710000
  739.          TS    TRMFLG             Do we have to really read?   @PG90058 05711000
  740.          BZ    RTRN0              Just a follow up. 0-len read @PG90058 05711300
  741.          MVI   FSFSFG,X'02'       Write/Read with Wcc          @PG90058 05711600
  742.          MVI   FSFSFG+1,X'80'     No data Compression                   05712000
  743.          MVC   FSFSRL(4),4(1)     Get buffer length Read       @PG90058 05713000
  744.          MVC   FSFSRB(4),0(1)     Get buffer address Read      @PG90058 05713500
  745.          MVC   FSFSWL(4),RIOPRP+4 Get buffer length Write      @PG90058 05714000
  746.          MVC   FSFSWB(4),RIOPRP   Get buffer address Write     @PG90058 05714500
  747.          MVI   ZLU,9              Specify Unit 9                        05715000
  748.          MFSET DSKST,FSIO                                               05716000
  749.          MFREQ DSKST              Do the I/O                            05717000
  750.          L     15,MFARSZ                                                05718000
  751.          TM    FL1,DEBUG          If DEBUG is on, then                  05719000
  752.          BZ    RTRN               also log the AID and cursor           05720000
  753.          TM    DBGFLG,DBGIO  I/O log wanted?                   @SC88168 05721000
  754.          BZ    RTRN          No, skip it                       @SC88168 05722000
  755.          L     2,LOGBUF      Ptr to buffer                     @SC87286 05723000
  756.          MVI   0(2),C'A'     Set label                         @SC87286 05724000
  757.          L     3,FSFSRB                                                 05725000
  758.          MVC   2(3,2),0(3)   Copy into buffer                  @SC87286 05726000
  759.          LR    9,15          Save data length                  @SC87286 05727000
  760.          WRITF LOGPTR,BSIZE=5 Log it                           @SC87286 05728000
  761.          TM    DBGFLG,DBGSV  Save log?                         @SC88168 05729000
  762.          BZ    SCRIOLZ       No, skip it                       @SC88168 05730000
  763.          SAVEF LOGPTR        Yes, close it                     @SC88168 05731000
  764. SCRIOLZ  DS    0H                                              @SC88168 05732000
  765.          LR    15,9          Return data length                @SC87286 05733000
  766.          B     RTRN          Return                            @SC86299 05734000
  767. *                                                                       05735000
  768. SCRWM    MVI   FSFSFG,X'86'       EW, WCC included, Skip Read           05736000
  769.          MVI   FSFSFG+1,X'A0'     No data Compression                   05737000
  770.          MVC   FSFSWL(4),4(1)     Get buffer length                     05738000
  771.          MVC   FSFSWB(4),0(1)     Get buffer address                    05739000
  772.          MVI   ZLU,9              Specify Unit 9                        05740000
  773.          MFSET DSKST,FSIO                                               05741000
  774.          MFREQ DSKST              Do the I/O                            05742000
  775.          B     RTRN0                                                    05743000
  776. RIOPRP   DC    A(0,1)                                          @PG90058 05743500
  777.          LOCALS ,                                                       05744000
  778. SCRNIO   EXIT  ,                                                        05745000
  779.          TITLE 'DISKIO Routine - performs disk I/O functions'           05746000
  780. * Function selected on entry by R0:                                     05747000
  781. * 0=> unnum: R1->FAB.  Return R1->buffer,R0=# and remove the sequence   05748000
  782. *   number (if any) from the buffer (used for TAKE files)               05749000
  783. * 1=> open (in): R1->pattern FDB, R2->name.  Returns R0->FAB, R1->FDB   05750000
  784. * 2=> open (out): (same)                                                05751000
  785. * 3=> test name: R2->name.  Returns R1->FDB if found (else R15=1)       05752000
  786. * 4=> close file: R1->adr(FAB).                                         05753000
  787. * 5=> set up search: R1->pattern name.                                  05754000
  788. * 6=> return next file in list:  Returns R1->FDB + sets up FILNAM       05755000
  789. * 7=> close search (if any).                                            05756000
  790. * 8=> test CWD string: R1->string.  Returns R15=0 if ok, else =1.       05757000
  791. * 9=> read: R1->FAB.  Returns R15=12 if EOF, 0 if ok; R0=# data         05758000
  792. * 10=> write: R1->FAB.  Returns R15=13 if disk full, 0 if ok.           05759000
  793. * 11=> test space: R1->pattern FDB (has size in Kbytes),                05760000
  794. *  R2->name (used if FAB not found), R6->adr(FAB). Return R15=0 if ok.  05760500
  795. * 12=> analyze R/W error, set ERRNUM, make EMSG: R1->FAB, TMPDW=code    05761000
  796. *      always returns R15=1                                             05762000
  797. * 13=> directory info on file: R1->name.  Returns R15=0 if ok.          05763000
  798. * 14=> delete file: R1->name.  Returns R15=0 if ok.                     05764000
  799. * 15=> rename file: R1->name, R2->new name.  Returns R15=0 if ok.       05765000
  800. * 16=> copy file: R1->name, R2->new name.  Returns R15=0 if ok.         05766000
  801. * 17-> type file: R1-> name. Returns R15=0 if ok.                       05767000
  802. * 21=> save file status in directory: R1->FAB.                 @SC88168 05768000
  803. * 22=> open library (in): R2->DDNAME.  Return R15=0 if ok.     @SC89073 05768200
  804. * 23=> point for next read, R1->adr(FDB), R2=records to skip.  @SC89218 05768300
  805. *      Return R15=0 if ok.                                     @SC89218 05768400
  806. DISKIO   ENTER                                                          05769000
  807.          USING FABD,3                                          @SC86295 05770000
  808.          SR    4,4           Signal no block assigned          @SC86295 05771000
  809.          STC   0,DSKCOD      Save function code (for now)      @SC88101 05772000
  810.          LR    5,0                                             @SC89073 05773000
  811.          AR    5,5                                             @SC89073 05773200
  812.          LH    5,DSK0(5)     Get handler address               @SC89073 05773400
  813.          B     DSK0(5)       Do the function                   @SC89073 05773600
  814. DSK0     DC    Y(DSKRED-DSK0,DSKOPNI-DSK0,DSKOPNO-DSK0)   0-2  @SC89073 05773800
  815.          DC    Y(DSKTEST-DSK0,DSKCLOS-DSK0,DSKNSET-DSK0)  3-5  @SC89073 05774000
  816.          DC    Y(DSKNXT-DSK0,DSKXSET-DSK0,DSKCWDF-DSK0)   6-8  @SC89073 05774200
  817.          DC    Y(DSKRED-DSK0,DSKWRT-DSK0,DSKTSP-DSK0)     9-11 @SC89073 05774400
  818.          DC    Y(DSKXXX-DSK0,DSKDIR-DSK0,DSKDEL-DSK0)    12-14 @SC89073 05774600
  819.          DC    Y(DSKRNM-DSK0,DSKCPY-DSK0,DSKTYP-DSK0)    15-17 @SC89073 05774800
  820.          DC    3Y(DSKER1-DSK0)   Spare utilities         18-20 @SC89073 05775000
  821.          DC    2Y(DSKER1-DSK0),Y(DSKPNT-DSK0)            21-23 @SC89218 05775200
  822.          DC    8Y(DSKER1-DSK0)   Spares                        @SC89073 05775400
  823. *                                                                       05776000
  824. * Open for input file whose name is at (R2), FDB at (R1)                05777000
  825. DSKOPNI  DS    0H                                              @SC89073 05777500
  826.          BAL   9,DSKALC      Get FAB                           @SC86295 05778000
  827.          MFSET DSKST,OPEN,R=(OKOLD,RDOK)                                05779000
  828.          MFREQ DSKST                        Try to open file            05780000
  829.          CLI   ZRC,0                        Errors ???                  05781000
  830.          BNZ   DSKER1        Not found                         @SC86295 05782000
  831.          MVC   FABRC,ZRC                                                05783000
  832.          BAL   9,DSKCHKNM          Check if allowed to do I/O           05784000
  833.           B     DSKER1                                                  05785000
  834.          BAL   14,DSKVALS          Go copy info to FDBD                 05786000
  835.          MVC   FABUNIT(1),ZLU      Save file unit number                05787000
  836.          B     RTRN0                                           @SC86295 05788000
  837. *                                                                       05789000
  838. * Open for output file whose name is at (R2), FDB at (R1)               05790000
  839. DSKOPNO  DS    0H                                              @SC89073 05791000
  840.          BAL   9,DSKALC      Get FAB                           @SC86295 05792000
  841.          MVC   FABCOMM,=CL8'Open'  In case of error            @SC88308 05793000
  842.          MFSET DSKST,EXTRACT                                   @SC88308 05796000
  843.          MFREQ DSKST         Get file attributes               @SC88308 05797000
  844.          CLI   ZRC,0         Did it work?                      @SC88308 05798000
  845.          BNE   DSKOP2        Not found, just writing new       @SC87012 05799000
  846.          TM    FDBFLGS,APPN+SVATT  Should we keep attributes?  @SC90033 05799500
  847.          BZ    *+8           No                                @SC90033 05800000
  848.           BAL  14,DSKVALS    Yes, copy old ones to FDB         @SC90033 05800500
  849.          TM    FDBFLGS,APPN  Appending?                        @SC90033 05801000
  850.          BO    DSKOP2        Yes, keep old file                @SC90033 05801500
  851. DSKOP1   DS    0H                                              @SC88308 05802000
  852.          MFSET DSKST,OPEN,R=(OKOLD,RDOK)                                05803000
  853.          MFREQ DSKST                                                    05804000
  854.          MVC   FABRC(1),ZRC                                             05805000
  855.          CLI   ZRC,30              Error deleting file ?                05806000
  856.          BE    DSKOP2              Yup, ignore it.                      05807000
  857.          BAL   9,DSKCHKNM          Check if allowed to do I/O           05808000
  858.           B     DSKER1                                                  05809000
  859.          MFSET DSKST,CLOSE,R=(DEL)                                      05810000
  860.          MFREQ DSKST               Delete the file...                   05811000
  861.          MVC   FABRC(1),ZRC                                             05812000
  862. DSKOP2   MVC   ZINFIN(LZINFDEF),ZINFDEF  Get default file attrs         05813000
  863.          SR    0,0                                                      05814000
  864.          ICM   0,3,FDBLRC    Insert logical record length               05815000
  865.          STH   0,MFIRSIZ                                                05816000
  866.          CLI   FDBRCF,C'V'   If not variable, then truncate             05817000
  867.          BNE   DSKSTLR                                         @SC88120 05818000
  868.          CLI   TYPFIL,C'B'   If variabel BUT binary, truncate           05819000
  869.          BE    DSKSTLR                                                  05820000
  870.          L     0,MAXLRC      TEXT file, no limit               @SC87012 05821000
  871. DSKSTLR  ST    0,FABLRTR     Set output buffer limit                    05822000
  872.          CLI   FDBRCF,C'F'   Fixed format ?                             05823000
  873.          BNE   *+8                                                      05824000
  874.          MVI   MFIRFM,X'02'  Yup, set to Fixed Compressed               05825000
  875.          MFSET DSKST,OPEN,R=(OKOLD,OKNEW,WROK)                          05826000
  876.          TM    FDBFLGS,APPN   Append to file ?                          05827000
  877.          BZ    *+8                                                      05828000
  878.          OI    DSKST+1,X'20'  Manually specify APPOK !                  05829000
  879.          MFREQ DSKST          Do the I/O                                05830000
  880.          CLI   ZRC,0          Any errors ?                              05831000
  881.          BNZ   DSKER1                                                   05832000
  882.          MVC   FABRC,ZRC     Save return code                           05833000
  883.          MVC   ZINFOUT(LZINFDEF),ZINFIN  Copy creation file parms       05834000
  884.          BAL   14,DSKVALS          Copy parms to FDBD                   05835000
  885.          OI    FDBFLGS,FWRITE      Write mode file                      05836000
  886.          MVC   FABUNIT(1),ZLU      Save the Unit number                 05837000
  887.          B     RTRN0                                           @SC86295 05838000
  888. *                                                                       05839000
  889. * Test for existence of file whose name is at (R2)                      05840000
  890. DSKTEST  DS    0H                                              @SC89073 05841000
  891.          MVC   MFNAME(LFID),0(2)   Get filename to test                 05842000
  892. DSKTST2  LA    3,DSKSTT      Get temporary FDB                 @SC88308 05843000
  893.          MFSET DSKST,EXTRACT                                   @SC88308 05844000
  894.          MFREQ DSKST               Get the file info...                 05845000
  895.          MVI   ZLU,0               Safety check...                      05846000
  896.          CLI   ZRC,0               Any errors ?                         05847000
  897.          BNZ   DSKER1                                                   05848000
  898.          BAL   14,DSKVALS          Go copy info to FDBD                 05849000
  899.          B     RTRN0                                                    05850000
  900. *                                                                       05851000
  901. * Close file whose ticket is at (R1), release block                     05852000
  902. DSKCLOS  DS    0H                                              @SC89073 05853000
  903.          ICM   3,15,0(1)     Get FAB ptr, if any               @SC86295 05854000
  904.          BZ    RTRN0         None, ignore                      @SC86295 05855000
  905.          XC    0(4,1),0(1)   Yes, now clear ticket             @SC86295 05856000
  906.          MVC   ZLU(1),FABUNIT      Copy file Unit number                05857000
  907.          LR    6,3                 Save the address of the FAB          05858000
  908.          MFSET DSKST,CLOSE                                              05859000
  909.          TM    FDBFLGS,FWRITE      Write mode file ?                    05860000
  910.          BZ    DSKCLS2                                                  05861000
  911.          OI    DSKST+1,X'10'       Yes, add RLSE option !               05862000
  912. DSKCLS2  MFREQ DSKST               Close the file                       05863000
  913.          LR    1,6                 Get FAB address                      05864000
  914.          LA    0,FABDWDS                                       @SC86295 05865000
  915.        DMSFRET DWORDS=(0),LOC=(1)  Free up the FAB                      05866000
  916.          B     RTRN0                                           @SC86295 05867000
  917. *                                                                       05867080
  918. * Point past 1st N records of file at (R1)                     @SC89218 05867160
  919. DSKPNT   ICM   3,15,0(1)     Get ticket                        @SC89218 05867240
  920.          BZ    RTRN1         Not open                          @SC89218 05867320
  921.          LR    3,1                                             @SC89218 05867400
  922.          LTR   2,2           Number of records to skip         @SC89218 05867480
  923.          BNP   RTRN0         Never mind                        @SC89218 05867560
  924. DSKPNTL  READF 0(,3),E=RTRN1 Skip one                          @SC89218 05867640
  925.          BCT   2,DSKPNTL     ... until finished                @SC89218 05867720
  926.          B     RTRN0         Return with completion code       @SC89218 05867800
  927. *                                                                       05868000
  928. * Read from file   R1->FAB                                              05869000
  929. DSKRED   DS    0H                                              @SC89073 05870000
  930. DSKRED2  LR    3,1                 Point to FAB                         05871000
  931.          MVC   FABCOMM(8),=CL8'Read'  I/O Operation                     05872000
  932.          L     0,FDBBUFF           Get buffer address                   05873000
  933.          ST    0,MFRBUF                                                 05874000
  934.          L     0,FDBBSIZ           Get I/O Length                       05875000
  935.          ST    0,MFRLEN                                                 05876000
  936.          MVC   ZLU(1),FABUNIT      Get unit number                      05877000
  937.          MFSET DSKST,IO,R=(RD)                                          05878000
  938.          MFREQ DSKST               Do the I/O                           05879000
  939.          MVC   FABRC(1),ZRC        Save the return code                 05880000
  940.          L     0,MFARSZ            Get length read from Save file.      05881000
  941.          RETREG 0            Return length as R0               @SC89218 05882000
  942.          CLI   ZRC,0               Any errors ???                       05884000
  943.          BE    RTRN0                                                    05885000
  944.          LA    15,12               End of file.                         05886000
  945.          CLI   ZRC,1               End of file maybe ???                05887000
  946.          BE    RTRN                                                     05888000
  947.          B     RTRN1               Well, just another error...          05889000
  948. *                                                                       05890000
  949. * Write to file    R1->FAB                                              05891000
  950. DSKWRT   DS    0H                                              @SC89073 05892000
  951.          LR    3,1                 Point to FAB                         05893000
  952.          MVC   FABCOMM(8),=CL8'Write'  I/O Operation                    05894000
  953.          L     0,FDBBUFF           Get buffer address                   05895000
  954.          ST    0,MFRBUF                                                 05896000
  955.          L     0,FDBBSIZ           Get I/O Length                       05897000
  956.          ST    0,MFRLEN                                                 05898000
  957.          MVC   ZLU(1),FABUNIT      Get unit number                      05899000
  958.          MFSET DSKST,IO,R=(WR)                                          05900000
  959.          MFREQ DSKST               Do the I/O                           05901000
  960.          MVC   FABRC(1),ZRC        Save the return code                 05902000
  961.          CLI   ZRC,0               Any errors ???                       05903000
  962.          BE    RTRN0                                                    05904000
  963.          LA    15,13               Disk full error code.                05905000
  964.          CLI   ZRC,40              Well, is it full ?                   05906000
  965.          BL    RTRN1                                                    05907000
  966.          CLI   ZRC,42              Three possible return codes          05908000
  967.          BH    RTRN1                                                    05909000
  968.          B     RTRN                                                     05910000
  969. *                                                                       05911000
  970. * Analyze error: Get error code from FABRC field of FAB !               05912000
  971. DSKXXX   DS    0H                                              @SC89073 05913000
  972.          LR    3,1                 Get address of FAB                   05914000
  973.          MVI   ERRNUM,ERRDIE       Set Kermit DISKIO error code         05915000
  974.          L     2,EMSGP             Ptr to msg buffer                    05916000
  975.          MVC   0(8,2),FABCOMM      Copy oprn name                       05917000
  976.          MVC   ZRC(1),FABRC        Get the error code                   05918000
  977.          LA    0,8(2)              Get address of where to pad          05919000
  978.          ST    0,MFRBUF            message                              05920000
  979.          LA    0,70                Maximum length of message            05921000
  980.          ST    0,MFRLEN                                                 05922000
  981.          MFSET DSKST,MSG           Convert RC to real message           05923000
  982.          MFREQ DSKST                                                    05924000
  983.          LA    0,79                Return maximum length of msg.        05925000
  984.          ST    0,EMSGL                                                  05926000
  985.          B     RTRN1                                           @SC87338 05927000
  986. *                                                                       05928000
  987. * Delete file R1->name, Return R15=0 if ok                              05929000
  988. DSKDEL   DS    0H                                              @SC89073 05930000
  989.          LA    3,DSKSTT             Temporary FAB needed                05931000
  990.          MVC   MFNAME(LFID),0(1)    Copy file name to delete            05932000
  991.          MFSET DSKST,OPEN,R=(OKOLD,RDOK)                                05933000
  992.          MFREQ DSKST              Try to open the file                  05934000
  993.          CLI   ZRC,0              Error ?                               05935000
  994.          BNE   DSKER2                                                   05936000
  995.          BAL   9,DSKCHKNM          Check if allowed to do I/O           05937000
  996.           B     DSKER2                                                  05938000
  997.          MFSET DSKST,CLOSE,R=(DEL)                                      05939000
  998.          MFREQ DSKST              Delete the file                       05940000
  999.          CLI   ZRC,0              Error ?                               05941000
  1000.          BNE   DSKER2                                                   05942000
  1001.          LA    2,0                File deleted message                  05943000
  1002. *                                                                       05944000
  1003. DSKMSG   SLL   2,4                Get the address of the message        05945000
  1004.          LA    1,DSKMTAB(2)                                    @SC88308 05946000
  1005.          LA    0,16          Length of msg                     @SC88308 05947000
  1006.          WTEXT (1),(0)                                         @SC88308 05948000
  1007.          MVI   ERRNUM,ERRNOE      No Errors                             05949000
  1008.          B     RTRN0                                                    05950000
  1009. *                                                                       05951000
  1010. * Rename file R1->name, R2->newname,  Return R15=0 if ok                05952000
  1011. DSKRNM   DS    0H                                              @SC89073 05953000
  1012.          LA    3,DSKSTT             Temporary FAB needed                05954000
  1013.          MVC   MFNAME(LFID),0(1)    Copy file name to delete            05955000
  1014.          MFSET DSKST,OPEN,R=(OKOLD,RDOK)                                05956000
  1015.          MFREQ DSKST                Try to open the file                05957000
  1016.          CLI   ZRC,0                Error ?                             05958000
  1017.          BNE   DSKER2                                                   05959000
  1018.          BAL   9,DSKCHKNM          Check if allowed to do I/O           05960000
  1019.           B     DSKER2                                                  05961000
  1020.          MVC   ZINFIN(LZINFDEF),ZINFDEF  Get default file attrs         05962000
  1021.          MVC   MFNAME(LFID),0(2)         Get new name                   05963000
  1022.          MFSET DSKST,CLOSE,R=(RENAME)                                   05964000
  1023.          MFREQ DSKST              Rename it !                           05965000
  1024.          LA    2,1                File renamed message                  05966000
  1025.          CLI   ZRC,0              Error on rename ?                     05967000
  1026.          BE    DSKMSG                                                   05968000
  1027.          CLI   ZLU,0              Is an additional close required ?     05969000
  1028.          BE    DSKER2                                                   05970000
  1029.          MFSET DSKST,CLOSE        Yes, close the file normally.         05971000
  1030.          MFREQ DSKST              Rename failed.                        05972000
  1031.          B     DSKER2                                                   05973000
  1032. *                                                                       05974000
  1033. * Copy file.  R1->name, R2->newname.  Return R15=0 if ok                05975000
  1034. DSKCPY   DS    0H                                              @SC89073 05976000
  1035.          LA    3,DSKSTT             Temporary FAB needed                05977000
  1036.          LA    7,1                  Error by default !!!                05978000
  1037.          MVC   MFNAME(LFID),0(1)    Get file name to copy               05979000
  1038.          MFSET DSKST,OPEN,R=(OKOLD,RDOK)                                05980000
  1039.          MFREQ DSKST              Try to open the file                  05981000
  1040.          CLI   ZRC,0              Error ?                               05982000
  1041.          BNE   DSKER2                                                   05983000
  1042.          BAL   9,DSKCHKNM          Check if allowed to do I/O           05984000
  1043.           B     DSKER2                                                  05985000
  1044.          SLR   8,8                                                      05986000
  1045.          ICM   8,1,ZLU             Save Read Unit Number                05987000
  1046.          L     9,MFEOFB            Get number of blks to copy           05988000
  1047.          MVC   PARMAREA(2),MFORSIZ     Save record size                 05989000
  1048.          MVC   PARMAREA+2(4),MFNLRC    Save Line count                  05990000
  1049.          MVC   PARMAREA+6(4),MFEOFB    Save last blk written            05991000
  1050.          MVC   PARMAREA+10(4),MFEOFD   Save displacement                05992000
  1051.          MVC   CMD(64),MFTAG Save tag                          @SC88308 05993000
  1052. *                                                                       05994000
  1053.          MVC   MFNAME(LFID),0(2)    Get destination                     05995000
  1054.          MVC   ZINFIN(LZINFDEF),ZINFOUT                                 05996000
  1055.          NI    MFIGCTL,X'7F'        Turn off common bit !!!             05997000
  1056.          MFSET DSKST,OPEN,R=(OKNEW,WROK)                                05998000
  1057.          MFREQ DSKST              Try to open the file                  05999000
  1058.          CLI   ZRC,0                                                    06000000
  1059.          BNE   DSKCP55            Error. New file open failed !         06001000
  1060.          ICM   8,2,ZLU            Save Write Unit Number                06002000
  1061. *                                                                       06003000
  1062.          LA    4,1                Starting blk number                   06004000
  1063.          LA    5,512              Number of blks to copy                06005000
  1064.          LA    6,2048             Address of buffer                     06006000
  1065.          A     6,WBUF                                                   06007000
  1066.          LTR   9,9                Anything left to do ???               06008000
  1067.          BZ    DSKCP50                                                  06009000
  1068. DSKCP20  STCM  8,1,ZLU            Set Unit number                       06010000
  1069.          STM   4,6,MFSBNU         Set read args                         06011000
  1070.          MFSET DSKST,UIO,R=(RD)                                         06012000
  1071.          MFREQ DSKST              Read a block                          06013000
  1072.          CLI   ZRC,0              Error reading ?                       06014000
  1073.          BNE   DSKCP55                                                  06015000
  1074.          STCM  8,2,ZLU            Set unit number                       06016000
  1075.          STM   4,6,MFSBNU         Set read args                         06017000
  1076.          MFSET DSKST,UIO,R=(WR)                                         06018000
  1077.          MFREQ DSKST              Write the block back                  06019000
  1078.          CLI   ZRC,0         Error writing?                    @SC88308 06020000
  1079.          BNE   DSKCP55                                                  06021000
  1080.          LA    4,1(4)             Next block                            06022000
  1081.          BCT   9,DSKCP20          until all done                        06023000
  1082. *                                                                       06024000
  1083. DSKCP50  SLR   7,7           Clear return code !                        06025000
  1084. DSKCP55  STCM  8,1,ZLU                                                  06026000
  1085.          CLI   ZLU,0         Is the input file open ???                 06027000
  1086.          BE    DSKCP60                                                  06028000
  1087.          MFSET DSKST,CLOSE   Yes, close the input file.                 06029000
  1088.          MFREQ DSKST                                                    06030000
  1089.          ICM   7,2,ZRC       Save the return code                       06031000
  1090. DSKCP60  STCM  8,2,ZLU                                                  06032000
  1091.          CLI   ZLU,0         Is the output file open ?                  06033000
  1092.          BE    DSKCP80                                                  06034000
  1093.          LTR   7,7           Any errors so far ?                        06035000
  1094.          BNZ   DSKCP65                                                  06036000
  1095.          MFSET DSKST,CLOSE,R=(SETEFP)  No, close and save file          06037000
  1096.          MVC   MFORSIZ(2),PARMAREA     Set record size                  06038000
  1097.          MVC   MFNLRC(4),PARMAREA+2    Set Line count                   06039000
  1098.          MVC   MFEOFB(4),PARMAREA+6    Set last blk written             06040000
  1099.          MVC   MFEOFD(4),PARMAREA+10   Set displacement                 06041000
  1100.          MVC   MFTAG(64),CMD Restore tag                       @SC88308 06042000
  1101.          B     DSKCP70                                                  06043000
  1102. DSKCP65  MFSET DSKST,CLOSE,R=(DEL)  Errors, delete file !               06044000
  1103. DSKCP70  MFREQ DSKST                                                    06045000
  1104.          ICM   7,4,ZRC       Get return code on Close                   06046000
  1105. DSKCP80  LR    15,7          Return it to Kermit !                      06047000
  1106.          B     RTRN                                                     06048000
  1107. *                                                                       06049000
  1108. * Type file.   R1-> name. Returns R15=0 if ok.                          06050000
  1109. DSKTYP   DS    0H                                              @SC89073 06051000
  1110.          LR    4,1           Point to file name                @PG88335 06052000
  1111.          OPENF I,(4),FILFDB,FILPTR,E=RTRN1                     @PG88335 06053000
  1112.          LR    3,0           Point to FAB                      @PG88335 06054000
  1113.          LH    1,FDBLRC                                        @PG88335 06055000
  1114.          CH    1,=H'130'     Check record length !!!           @PG88335 06056000
  1115.          BL    DSKTYP20                                        @PG88335 06057000
  1116.          WTEXT 'Only first 130 characters displayed!'          @PG88335 06058000
  1117. DSKTYP20 L     3,RBUF        Point to data buffer              @PG88335 06059000
  1118.          READF FILPTR,BUFFER=(3),E=DSKTYP50                    @PG88335 06060000
  1119.          CH    0,=H'130'     Record too long ?                 @PG88335 06061000
  1120.          BL    DSKTYP30                                        @PG88335 06062000
  1121.          LA    0,129         Yes, truncate...                  @PG88335 06063000
  1122. DSKTYP30 LTR   0,0           Is it null ?                      @PG88335 06064000
  1123.          BNZ   DSKTYP35                                        @PG88335 06065000
  1124.          MVI   0(3),X'40'    Then we must have at least        @PG88335 06066000
  1125.          LA    0,1           one character to output           @PG88335 06067000
  1126. DSKTYP35 WTEXT (3)                                             @PG88335 06068000
  1127.          B     DSKTYP20                                        @PG88335 06069000
  1128. DSKTYP50 C     15,F12        EOF code ?                        @PG88335 06070000
  1129.          BE    DSKTYP70                                        @PG88335 06071000
  1130.          ERRF  ,             Analyze error code                @PG88335 06072000
  1131.          CLOSF FILPTR                                          @PG88335 06073000
  1132.          B     RTRN1                                           @PG88335 06074000
  1133. DSKTYP70 CLOSF FILPTR                                          @PG88335 06075000
  1134.          B     RTRN0                                           @PG88335 06076000
  1135. *                                                                       06077000
  1136. * Return on error, release useless block, if any                        06078000
  1137. DSKER1   LTR   1,4           Any block assigned?               @SC86295 06079000
  1138.          BZ    RTRN1         No                                @SC86295 06080000
  1139.          LA    0,FABDWDS     Yes, release it                   @SC86295 06081000
  1140.        DMSFRET DWORDS=(0),LOC=(1)                              @SC86295 06082000
  1141.          B     RTRN1         Flag error                        @SC86295 06083000
  1142. * Error return from disk utilities. Set ERRNUM properly.                06084000
  1143. DSKER2   CLI   ZRC,12                                                   06085000
  1144.          BNE   DSKER3                                                   06086000
  1145.          MVI   ERRNUM,ERRFNE  Invalid filename                          06087000
  1146.          B     RTRN1                                                    06088000
  1147. DSKER3   CLI   ZRC,30                                                   06089000
  1148.          BNE   DSKER4                                                   06090000
  1149.          MVI   ERRNUM,ERRFNF  File not found                            06091000
  1150.          B     RTRN1                                                    06092000
  1151. DSKER4   MVI   ERRNUM,ERRDIE  Disk I/O Error                            06093000
  1152.          B     RTRN1                                                    06094000
  1153. * Allocate FAB and copy default FDB                                     06095000
  1154. DSKALC   LR    5,1           Save FDB ptr                      @SC86295 06096000
  1155.          MVC   MFNAME,0(2)                                              06097000
  1156.          LA    0,FABDWDS                                       @SC86295 06098000
  1157.        DMSFREE DWORDS=(0),ERR=DSKER1                           @SC86295 06099000
  1158.          LR    3,1           New block ptr                     @SC86295 06100000
  1159.          LA    4,FDBD        FDB pointer                       @SC88120 06101000
  1160.          RETREG (0,3),(1,4)  Return FAB ptr in R0, FDB in R1   @SC89218 06102000
  1161.          LR    4,3           Indicate we have it               @SC88120 06104000
  1162.          XC    0(8*FABDWDS,3),0(3)                             @SC86295 06105000
  1163.          MVC   FDBD(FDBCOP),0(5) Copy user's FDB               @SC86295 06106000
  1164.          MVC   FABFN(LFID),0(2)  Copy filename to FAB                   06107000
  1165.          BR    9                                               @SC86295 06108000
  1166. *                                                                       06109000
  1167. * Set up search through list of files, pattern at (R1)                  06110000
  1168. DSKNSET  DS    0H                                              @SC89073 06111000
  1169.          MVC   SCODE,UCODE        Get default user code                 06112000
  1170.          MVC   NXFN(LFID),0(1)    Save pattern name                     06113000
  1171.          CLI   4(1),C':'          Code specified in filename ?          06114000
  1172.          BNE   DSKNS4             Nope.                                 06115000
  1173.          MVC   SCODE(4),0(1)      Get the new code for search           06116000
  1174.          MVC   NXFN(LFID),BLNAME  Clear the filename pattern            06117000
  1175.          MVC   NXFN(17),5(1)      Copy filename part only               06118000
  1176. DSKNS4   CLC   SCODE(4),=CL4'*USR' Do we really want the user's code ?  06119000
  1177.          BNE   DSKNS6                                                   06120000
  1178.          MVC   SCODE(4),$USRCDE   Yes, then put in the real thing       06121000
  1179. DSKNS6   MVI   NXFLG,NFSOK        Clear flag byte                       06122000
  1180.          LA    2,LFID             Max length of filename                06123000
  1181.          LA    3,NXFN+LFID                                              06124000
  1182. DSKNS8   BCTR  3,0                                                      06125000
  1183.          CLI   0(3),C'?'          Is it a wildcard ?                    06126000
  1184.          BE    DSKNS10                                                  06127000
  1185.          CLI   0(3),C'*'          Is it a wildcard ?                    06128000
  1186.          BE    DSKNS10                                                  06129000
  1187.          BCT   2,DSKNS8                                                 06130000
  1188.          B     RTRN0              No wildcards, Grreat !!!              06131000
  1189. *                                                                       06132000
  1190. DSKNS10  CLC   SCODE(4),$USRCDE   Are we searching our library ?        06133000
  1191.          BE    DSKNS12                                                  06134000
  1192.          TM    UPRIVS,FILES+LSCAN No, then we need some privs !!!       06135000
  1193.          BZ    DSKNS15                                                  06136000
  1194. DSKNS12  LA    1,NXFN+LFID        End of token if no blanks             06137000
  1195.          TRT   NXFN(LFID),TRTBL   Find 1st blank                        06138000
  1196.          LA    2,NXFN                                                   06139000
  1197.          SR    1,2                Calc length of string                 06140000
  1198.          ST    1,NXFNL            Save it...                            06141000
  1199.          OI    NXFLG,NFWLD        Wildcard search necessary !           06142000
  1200.          L     2,MFINDBUF                                               06143000
  1201.          CALL  MFIND1,((2),F10,SCODE,F0,ZRC),VL,MF=(E,PARMAREA)         06144000
  1202.          LTR   15,15              Any errors ???                        06145000
  1203.          BZ    RTRN0                                                    06146000
  1204. DSKNS15  OI    NXFLG,NFERR        Error on MFIND1 call                  06147000
  1205.          B     RTRN1                                                    06148000
  1206. *                                                                       06149000
  1207. * Flush previous file pattern                                           06150000
  1208. DSKXSET  DS    0H                                              @SC89073 06151000
  1209.          MVI   NXFLG,0            Clear flag byte                       06152000
  1210.          B     RTRN0                                                    06153000
  1211. *                                                                       06154000
  1212. * Check CWD string, return code in R15                                  06155000
  1213. DSKCWDF  DS    0H                                              @SC89073 06156000
  1214.          B     RTRN0                                                    06157000
  1215. *                                                                       06158000
  1216. * Check disk space for proposed file: FDB at (R1), FAB ptr at (R6)      06159000
  1217. DSKTSP   L     5,FDBSIZE-FDBD(,1)  Get actual size             @SC90037 06159200
  1218.          ICM   3,15,0(6)     Get FAB ptr                       @SC90037 06159400
  1219.          BNZ   DSKTSP0       Not open yet                      @SC90037 06159600
  1220.          MVC   MFNAME(LFID),0(2)   Get filename                @SC90037 06159800
  1221.          LA    3,DSKSTT      Get temporary FDB                 @SC90037 06160000
  1222.          MFSET DSKST,EXTRACT                                   @SC90037 06160200
  1223.          MFREQ DSKST         Get the file info                 @SC90037 06160400
  1224.          MVI   ZLU,0         For safety                        @SC90037 06160600
  1225.          CLI   ZRC,0         Found it?                         @SC90037 06160800
  1226.          BNE   DSKTSP0       Not found, nothing to erase       @SC90037 06161000
  1227.          L     1,MFOPRM      Old file size in KBytes           @SC90037 06161200
  1228.          SR    5,1           Assume old file will be erased    @SC90037 06161400
  1229.          BNP   RTRN0         Will release enough for new file  @SC90037 06161600
  1230. DSKTSP0  DS    0H            Check free space                  @SC90037 06161800
  1231.          MFSET DSKST,USERCTL    Get User Control Record to              06163000
  1232.          MFREQ DSKST            determine how much space the            06164000
  1233.          MVC   FABRC(1),ZRC     user has left. Save return code !       06165000
  1234.          L     1,MFMAXS         Get max allocation space                06166000
  1235.          S     1,MFACUR         Subtract amt allocated                  06167000
  1236.          CLR   1,5                                             @SC90037 06168000
  1237.          BL    RTRN1         No room                           @SC86316 06169000
  1238.          B     RTRN0         Ok                                @SC86316 06170000
  1239. *                                                                       06171000
  1240. DSKVALS  LA    0,FDBD        Ptr to FDB                        @SC86295 06172000
  1241.          RETREG (1,0)        Return FDB ptr as R1              @SC89218 06173000
  1242. ***  GET FILE'S DATE...                                                 06175000
  1243.          SR    7,7                                             @SC87296 06176000
  1244.          IC    7,DS1CRDT     Get year in binary                @SC87296 06177000
  1245.          CVD   7,TMPDW                                         @SC87296 06178000
  1246.          MVO   FDBDATE+1(2),TMPDW Copy year                    @SC87296 06179000
  1247.          ICM   7,3,DS1CRDT+1 Get day-of-year in binary         @SC87296 06180000
  1248.          MVC   DSKMNTH,=AL1(30,31,30,31,31,30,31,30,31,28,31)  @SC86299 06181000
  1249.          TM    DS1CRDT,3                                       @SC87296 06182000
  1250.          BNZ   *+8                                             @SC87296 06183000
  1251.          MVI   DSKMNTH+9,29  Leap year, change Feb.            @SC86299 06184000
  1252.          LA    6,11                                            @SC86299 06185000
  1253.          SR    0,0                                             @SC86299 06186000
  1254. DSKVMDL  IC    0,DSKMNTH-1(6)                                  @SC86299 06187000
  1255.          SR    7,0           Test if passed the right month    @SC86299 06188000
  1256.          BNP   DSKVMDM       Got it                            @SC86299 06189000
  1257.          BCT   6,DSKVMDL                                       @SC86299 06190000
  1258.          SR    0,0           Hit December                      @SC86299 06191000
  1259. DSKVMDM  AR    7,0           Get day of month                  @SC86299 06192000
  1260.          LCR   6,6                                             @SC86299 06193000
  1261.          LA    6,12(6)       Get month                         @SC86299 06194000
  1262.          MH    6,=H'100'                                       @SC86299 06195000
  1263.          AR    6,7           Combine MMDD                      @SC86299 06196000
  1264.          MH    6,=H'10'                                        @SC86299 06197000
  1265.          CVD   6,TMPDW                                         @SC86299 06198000
  1266.          MVC   FDBDATE+2(2),TMPDW+5                            @SC86299 06199000
  1267.          MVI   FDBDATE,X'19' Assume 20th Cent                  @SC86295 06200000
  1268.          CLI   FDBDATE+1,X'50'                                 @SC86295 06201000
  1269.          BH    *+8           Ok                                @SC86295 06202000
  1270.          MVI   FDBDATE,X'20' Must be 21st                      @SC86295 06203000
  1271.          L     1,MFOPRM      Set file size in KBytes                    06204000
  1272.          ST    1,FDBSIZE                                                06205000
  1273.          SLR   1,1           Set record format character                06206000
  1274.          IC    1,MFORFM      Ignore 'Compressed' modes.                 06207000
  1275.          SLL   1,1                                                      06208000
  1276.          LA    0,RFMTAB                                                 06209000
  1277.          AR    1,0                                                      06210000
  1278.          MVC   FDBRCF,0(1)                                              06211000
  1279.          MVC   FDBLRC(2),MFORSIZ  Get logical record length             06212000
  1280.          NI    FDBFLGS,255-FWRITE Clear the write mode flag             06213000
  1281.          BR    14                                                       06214000
  1282. *                                                                       06215000
  1283. *        NXTFST Routine - searches through Save Library Index           06216000
  1284. *                                                                       06217000
  1285. DSKNXT   DS    0H                                              @SC89073 06218000
  1286.          TM    NXFLG,NFSOK        Was a search set up ???               06219000
  1287.          BZ    RTRN1                                                    06220000
  1288.          TM    NXFLG,NFERR+NFEND  Error or End of search ???            06221000
  1289.          BNZ   RTRN1                                                    06222000
  1290. *                                                                       06223000
  1291.          TM    NXFLG,NFWLD        Do we need to call MFINDX ?           06224000
  1292.          BO    DSKSRCH                                                  06225000
  1293.          OI    NXFLG,NFEND        End of search...                      06226000
  1294.          LA    1,NXFN             Source name was good. Use it!         06227000
  1295. DSKFND   MVC   MFNAME(5),SCODE  Rebuild the complete filename  @SC88308 06228000
  1296.          MVC   MFNAME+5(17),0(1)  info on the file.                     06229000
  1297.          MVC   FILNAM(LFID),MFNAME  Setup FILNAM !!!                    06230000
  1298.          B     DSKTST2                                                  06231000
  1299. *                                                                       06232000
  1300. DSKSRCH  CALL  MFINDX,(FCODE,LCFN,NXFLTYP,NXSVFLG,NXBKNUM,NXDIRLOC),VL,+06233000
  1301.                MF=(E,PARMAREA)                                          06234000
  1302.          C     15,F4              End of library search ?               06235000
  1303.          BNE   NXT20                                                    06236000
  1304.          OI    NXFLG,NFEND        Yes, end of search                    06237000
  1305.          B     RTRN1                                                    06238000
  1306. NXT20    LTR   15,15              Error in search ?                     06239000
  1307.          BZ    NXT30                                                    06240000
  1308.          OI    NXFLG,NFSERRS+NFERR Yes, error in search        @SC88308 06241000
  1309.          B     RTRN1                                                    06242000
  1310. NXT30    CLC   NXFLTYP,F0         Skip over common entries              06243000
  1311.          BNE   DSKSRCH                                                  06244000
  1312.          CLI   LCFN,C'.'          Skip over temporary files             06245000
  1313.          BE    DSKSRCH                                                  06246000
  1314.          CLC   FCODE(4),SCODE     Is this the right code ???            06247000
  1315.          BNE   DSKSRCH                                                  06248000
  1316.          CALL  MATCH,(LCFN,FM17,NXFN,NXFNL,ASTER,QUEST),VL,            +06249000
  1317.                MF=(E,PARMAREA)                                          06250000
  1318.          LTR   0,0                Well, did they match ???              06251000
  1319.          BZ    DSKSRCH                                                  06252000
  1320.          LA    1,LCFN             Point to name found and go            06253000
  1321.          B     DSKFND             copy it and set FDB                   06254000
  1322. *                                                                       06255000
  1323. * Directory Info on file R1->name, return R15=0 if OK                   06256000
  1324. DSKDIR   DS    0H                                              @SC89073 06257000
  1325.          NXTFSET E=DSKDRERR  Set up search (name at R1)        @SC88308 06258000
  1326. DSKDRLP  NXTF  E=DSKDRZ      Find next entry                   @SC88308 06259000
  1327.          OI    NXFLG,NFFND   Found something, at least one     @SC88308 06260000
  1328.          LA    1,CMD         Yes, build the filename with      @SC88308 06261000
  1329.          LR    2,1                the attributes we want in a           06262000
  1330.          LA    3,LFID        Length of name buffer             @SC88308 06263000
  1331.          LA    4,MFNAME                                        @SC88308 06264000
  1332.          LR    5,3                                             @SC88308 06265000
  1333.          CLC   0(4,4),$USRCDE   User's code?                   @SC88308 06266000
  1334.          BNE   *+12          No                                @SC88308 06267000
  1335.           A    4,F5          Yes, skip over it for output      @SC88308 06268000
  1336.           S    3,F5                                            @SC88308 06269000
  1337.          MVCL  2,4                                             @SC88308 06270000
  1338.          ICM   0,3,MFORSIZ                                              06271000
  1339.          BAL   9,DSKNUM           Add the logical record length         06272000
  1340.          MVC   0(2,2),BLNAME Leave some blanks                 @SC88308 06273000
  1341.          SLR   3,3                                                      06274000
  1342.          IC    3,MFORFM           Get record format                     06275000
  1343.          SLL   3,1                                                      06276000
  1344.          LA    3,RFMTAB(3)        Get address of printable value        06277000
  1345.          MVC   2(2,2),0(3)   Add to line                       @SC88308 06278000
  1346.          LA    2,4(2)        Bump the length                   @SC88308 06279000
  1347.          ICM   0,15,MFOPRM                                              06280000
  1348.          BAL   9,DSKNUM           Add the file size in Kbytes           06281000
  1349.          MVI   0(2),C'K'                                                06282000
  1350.          LA    2,1(2)                                                   06283000
  1351.          ICM   0,15,MFNLRC        Add the number of lines               06284000
  1352.          BAL   9,DSKNUM                                                 06285000
  1353.          MVC   0(6,2),=C' lines'                                        06286000
  1354.          LA    2,6(2)                                                   06287000
  1355. *                                                                       06288000
  1356.          SR    2,1                Get the output length                 06289000
  1357.          WTEXT (1),(2)                                                  06290000
  1358.          B     DSKDRLP                                         @SC88308 06291000
  1359. *                                                              @SC88308 06292000
  1360. DSKDRZ   TM    NXFLG,NFSERRS+NFERR                             @SC88308 06293000
  1361.          BNZ   DSKDRERR      Report error                      @SC88308 06294000
  1362.          TM    NXFLG,NFFND   Any files found?                  @SC88308 06295000
  1363.          BO    RTRN0         Yes, return gracefully            @SC88308 06296000
  1364. DSKDRERR PTEXT 'Not found'                                     @SC88308 06297000
  1365.          B     SUBERR                                          @SC88308 06298000
  1366. *                                                                       06299000
  1367. DSKNUM   CVD   0,TMPDW            Pack the binary value                 06300000
  1368.          OI    TMPDW+7,15         Set zone                              06301000
  1369.          UNPK  0(8,2),TMPDW       Convert to printable                  06302000
  1370.          LA    5,7(2)             Point to end of string                06303000
  1371. DSKNUM2  CLI   0(2),C'0'          Remove leading zeros                  06304000
  1372.          BNE   DSKNUM3            except for the first one.             06305000
  1373.          MVI   0(2),C' '                                                06306000
  1374.          LA    2,1(2)                                                   06307000
  1375.          CR    2,5                                                      06308000
  1376.          BL    DSKNUM2                                                  06309000
  1377. DSKNUM3  LA    2,1(5)             Get the new ending address            06310000
  1378.          BR    9                                                        06311000
  1379. *                                                                       06312000
  1380. *  Check for privs to open filename                                     06313000
  1381. *  R3->FAB,  R9->returns                                       @SC88308 06314000
  1382. DSKCHKNM TM    UPRIVS,FILES+LSCAN If FILES, never any problems          06315000
  1383.          BNZ   4(9)                                                     06316000
  1384.          CLC   MFUIFC(4),$USRCDE  If our own code, then no problem      06317000
  1385.          BE    4(9)                                                     06318000
  1386.          TM    MFOACNB,X'A0'      Allowed to read file ???              06319000
  1387.          BZ    4(9)                                                     06320000
  1388.          MVI   FABRC,21           Not your library error.               06321000
  1389.          CLI   ZLU,0              Is the file still open ?              06322000
  1390.          BER   9                                                        06323000
  1391.          MFSET DSKST,CLOSE        Yes, close it normally...             06324000
  1392.          MFREQ DSKST                                                    06325000
  1393.          BR    9                  Error return                          06326000
  1394. *                                                                       06327000
  1395. RFMTAB   DC    C'U F FCV VC'      Record Format Table                   06328000
  1396. DSKMTAB  DC    CL16'File deleted'                                       06329000
  1397.          DC    CL16'File renamed'                                       06330000
  1398.          DC    CL16'File copied'                                        06331000
  1399.          LOCALS ,                                                       06332000
  1400. DS1CRDT  DS    XL1,XL2       Creation date AL1(yr),AL2(day)    @SC86299 06333000
  1401. DSKMNTH  DS    XL11          Month length table                @SC86299 06334000
  1402. DSKCOD   DS    X             Saved DISKIO code                 @SC88308 06335000
  1403.          DROP  R3                                                       06336000
  1404.          EXIT                                                           06337000
  1405.          EJECT                                                          06338000
  1406.